<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>搜索检测界面</title>
    <link rel="shortcut icon" th:href="@{/logo/favicon.ico}"/>
    <!-- Custom fonts for this template-->
    <link rel="stylesheet" type="text/css" th:href="@{/vendor/fontawesome-free/css/all.min.css}"/>
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">
    <!-- Custom styles for this template-->
    <link rel="stylesheet" type="text/css" th:href="@{/css/sb-admin-2.min.css}"/>
    <!-- Custom styles for this page -->
    <link rel="stylesheet" type="text/css" th:href="@{/vendor/datatables/dataTables.bootstrap4.min.css}"/>
</head>
<style>
    #search {
        padding-top: 10%;
    }
</style>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
    <!-- Sidebar -->
    <div th:if="${role} == 2" style="height: auto;background-color: #224abe;">
        <div  th:replace="commons/admin_sidebar::#accordionSidebar" ></div>
    </div>
    <div th:if="${role} == 4" style="height: auto;background-color: #224abe;">
        <div th:replace="commons/aduit_sidebar::#accordionSidebar"></div>
    </div>
    <div th:if="${role} == 3" style="height: auto;background-color: #224abe;">
        <div th:replace="commons/aduit_sidebar::#accordionSidebar"></div>
    </div>
    <div th:if="${role} == 1" style="height: auto;background-color: #224abe;">
        <div th:replace="commons/user_sidebar::#accordionSidebar"></div>
    </div>
    <!-- End of Sidebar -->
    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">
        <!-- Main Content -->
        <div id="content">
            <!-- Topbar -->
            <div th:replace="commons/user_navbar::#navbar"></div>
            <div class="row" style="height: 100%">
                <div id="search" class="center-block" style="margin: 0px auto">
                    <label>流水号:</label>
                    <input type="text" id="lsh" required>
                    <button class="btn btn-success" onclick="searchMhyProcessDataByLsh()">搜索</button>
                    <hr>
                    <label>车牌号:</label>
                    <input type="text" id="cph" required>
                    <button class="btn btn-success"  onclick="searchMhyProcessDataByCph()">搜索</button>
                </div>
            </div>
        </div>
        <!-- End of Main Content -->
        <!-- Footer -->
        <div th:replace="commons/footer::#footer"></div>
        <!-- End of Footer -->
    </div>
    <!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<div th:replace="commons/logout::#logoutModal"></div>
<!-- Bootstrap core JavaScript-->
<script type="text/javascript" th:src="@{/vendor/jquery/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/vendor/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script type="text/javascript" th:src="@{/js/user_commons.js}"></script>
<!-- Core plugin JavaScript-->
<script type="text/javascript" th:src="@{/vendor/jquery-easing/jquery.easing.min.js}"></script>
<!-- Custom scripts for all pages-->
<script type="text/javascript" th:src="@{/js/sb-admin-2.min.js}"></script>
</body>
<script>
function searchMhyProcessDataByLsh() {
    var data = $("#lsh").val().trim();
    if (data == "") {
        alert("流水号不能为空!");
        return;
    }
    $.ajax({
        url:"/vehicle/getByProcessNo",
        type:"get",
        data:{"processNo":data},
        success:function (res) {
            if(res.code == 200){
                window.open("/vehicle/view?vId="+res.data);
            }else{
                alert(res.message);
            }
        }
    });
}
function searchMhyProcessDataByCph() {
    var data = $("#cph").val().trim();
    if (data == "") {
        alert("车牌号不能为空!");
        return;
    }
    $.ajax({
        url:"/vehicle/getByMhyPlate",
        type:"get",
        data:{"mhyPlate":data},
        success:function (res) {
            if(res.code == 200){
                window.open("/vehicle/view?vId="+res.data);
            }else{
                alert(res.message);
            }
        }
    });
}
</script>
</html>
